package com.kfm.wiki.controller;

import com.kfm.wiki.entity.Content;
import com.kfm.wiki.service.ContentService;
import com.kfm.wiki.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/content")
public class ContentController {

    @Autowired
    private ContentService contentService;

    @GetMapping("/{id}")
    public R getById(@PathVariable Long id){
        Content content = contentService.getContentById(id);
        return R.ok(content);
    }
}
